<template>
    <div>
        <el-table
        :data="config.tableData"
        :lazy="config.lazy"
        :row-key="config.rowKey"
        :load="config.load"
        :max-height="config.maxHeight"
        :height="config.height"
        >
            <el-table-column 
            :fixed="colum.fixed" 
            :label="colum.label" 
            :prop="colum.prop" 
            :align="colum.align"
            show-overflow-tooltip
            v-for="(colum,index) in config.columns" 
            :key="index"
            >
            
            </el-table-column>
            
            <el-table-column prop="option" label="操作">
                <template slot-scope="scope">
                    <slot name="option" :row="scope"></slot>
                </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
    export default{
        data(){

        },
        props:{
            tableData:{
                type:Array,
                default:[]
            },
            config:{
                type:Object,
                default:{
                    load:function(){},
                    columns:[],
                    lazy:false,
                    rowKey:'id',
                    treeProps:{ hasChildren: 'hasChildren', children: 'children' },
                    maxHeight:400,
                    height:400
                }
            }
        }
    }
</script>